CREATE TABLE  jms_dim.yl_lmdm_sys_area(
`id` bigint(20) NULL COMMENT '主键id',
`parent_id` bigint(20) NULL COMMENT '父级ID',
`country_id` bigint(20) NULL COMMENT '所属国家',
`code` varchar(500) NULL COMMENT '区域编码',
`dt` date NULL comment '分区日期',
`international_code` varchar(500) NULL COMMENT '国际编码',
`three_code` varchar(500) NULL COMMENT '三字码',
`type` bigint(20) NULL COMMENT '区域类型',
`cn_name` varchar(500) NULL COMMENT '中文名称',
`en_name` varchar(500) NULL COMMENT '英文名称',
`abbreviation` varchar(500) NULL COMMENT '简称',
`native_name` varchar(500) NULL COMMENT '母语名称',
`area_no` varchar(500) NULL COMMENT '区号',
`zipcode` varchar(500) NULL COMMENT '邮政编码',
`longitude` varchar(500) NULL COMMENT '经度',
`latitude` varchar(500) NULL COMMENT '纬度',
`is_enable` int(11) NULL COMMENT '是否启用',
`is_delete` int(11) NULL COMMENT '是否删除:1未删除,2已删除',
`create_by` bigint(20) NULL COMMENT '创建人ID',
`update_by` bigint(20) NULL COMMENT '最后更新人ID',
`create_by_name` varchar(500) NULL COMMENT '创建人名称',
`update_by_name` varchar(500) NULL COMMENT '最后修改人名称',
`create_time` datetime NULL COMMENT '创建时间',
`update_time` datetime NULL COMMENT '更新时间',
`version` varchar(500) NULL COMMENT '版本号',
`sort` int(11) NULL COMMENT '排序',
`dtb_name` varchar(500) NULL COMMENT '大头笔名称',
`ad_code` varchar(500) NULL COMMENT '高德编码',
`no_district_flag` int(11) NULL COMMENT '无区县标识 1:无区县,2:有区县'
 ) ENGINE=OLAP
DUPLICATE KEY(`id`, `parent_id`, `country_id`,`code`)
COMMENT "系统区域表"
PARTITION BY RANGE(`dt`)
(PARTITION p20210918 VALUES [('2021-09-18'), ('2021-09-19')),
PARTITION p20210919 VALUES [('2021-09-19'), ('2021-09-20')),
PARTITION p20210920 VALUES [('2021-09-20'), ('2021-09-21'))
)
DISTRIBUTED BY HASH(`code`) BUCKETS 2
PROPERTIES (
"replication_num" = "3",
"dynamic_partition.enable" = "true",
"dynamic_partition.time_unit" = "DAY",
"dynamic_partition.time_zone" = "Asia/Shanghai",
"dynamic_partition.start" = "-7",
"dynamic_partition.end" = "3",
"dynamic_partition.prefix" = "p",
"dynamic_partition.buckets" = "2",
"in_memory" = "false",
"storage_format" = "V2"
);